var win;
var pano;
var pano_warp;

$(function(){
  win = $(window)
  pano = $("#pano")
  pano_warp = $("#pano_warp")

  pano_size()
  var panoSizeLazy = _.debounce(pano_size, 300)
  win.resize(panoSizeLazy)
})

var pano_size = function() {
  var width = pano_warp.width()
  var height = win.innerHeight()
  if (width/3*2 >= height) {
    pano.width(width)
    pano.height(height)
  }
  else {
    pano.height(width/3*2)
    pano.width(width)
  }
}
